﻿
namespace Indeco.G24.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.NhaCungCapLienHe"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class NhaCungCapLienHeEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the IDNhaCungCapLienHe property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIDNhaCungCapLienHe;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDNhaCungCapLienHe property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDNhaCungCapLienHeLabel;
		
		/// <summary>
		/// ComboBox for the IDNhaCungCap property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDNhaCungCap;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDNhaCungCap property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDNhaCungCapLabel;
		
		/// <summary>
		/// TextBox for the HoTen property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxHoTen;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the HoTen property.
		/// </summary>
		protected System.Windows.Forms.Label uxHoTenLabel;
		
		/// <summary>
		/// TextBox for the Email property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxEmail;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Email property.
		/// </summary>
		protected System.Windows.Forms.Label uxEmailLabel;
		
		/// <summary>
		/// TextBox for the DiaChi property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxDiaChi;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DiaChi property.
		/// </summary>
		protected System.Windows.Forms.Label uxDiaChiLabel;
		
		/// <summary>
		/// TextBox for the TieuDe property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTieuDe;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the TieuDe property.
		/// </summary>
		protected System.Windows.Forms.Label uxTieuDeLabel;
		
		/// <summary>
		/// TextBox for the NoiDung property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNoiDung;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the NoiDung property.
		/// </summary>
		protected System.Windows.Forms.Label uxNoiDungLabel;
		
		/// <summary>
		/// DataTimePicker for the ThoiDiemCapNhat property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxThoiDiemCapNhat;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ThoiDiemCapNhat property.
		/// </summary>
		protected System.Windows.Forms.Label uxThoiDiemCapNhatLabel;
		#endregion
		
		#region Main entity
		private Entities.NhaCungCapLienHe _NhaCungCapLienHe;
		/// <summary>
		/// Gets or sets the <see cref="Entities.NhaCungCapLienHe"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.NhaCungCapLienHe"/> instance.</value>
		public Entities.NhaCungCapLienHe NhaCungCapLienHe
		{
			get {return this._NhaCungCapLienHe;}
			set
			{
				this._NhaCungCapLienHe = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIDNhaCungCapLienHe.DataBindings.Clear();
			this.uxIDNhaCungCapLienHe.DataBindings.Add("Text", this.uxBindingSource, "IDNhaCungCapLienHe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDNhaCungCap.DataBindings.Clear();
			this.uxIDNhaCungCap.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDNhaCungCap", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxHoTen.DataBindings.Clear();
			this.uxHoTen.DataBindings.Add("Text", this.uxBindingSource, "HoTen", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxEmail.DataBindings.Clear();
			this.uxEmail.DataBindings.Add("Text", this.uxBindingSource, "Email", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDiaChi.DataBindings.Clear();
			this.uxDiaChi.DataBindings.Add("Text", this.uxBindingSource, "DiaChi", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTieuDe.DataBindings.Clear();
			this.uxTieuDe.DataBindings.Add("Text", this.uxBindingSource, "TieuDe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNoiDung.DataBindings.Clear();
			this.uxNoiDung.DataBindings.Add("Text", this.uxBindingSource, "NoiDung", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxThoiDiemCapNhat.DataBindings.Clear();
			this.uxThoiDiemCapNhat.DataBindings.Add("Value", this.uxBindingSource, "ThoiDiemCapNhat", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="NhaCungCapLienHeEditControlBase"/> class.
		/// </summary>
		public NhaCungCapLienHeEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_NhaCungCapLienHe != null) _NhaCungCapLienHe.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIDNhaCungCapLienHe = new System.Windows.Forms.TextBox();
			uxIDNhaCungCapLienHeLabel = new System.Windows.Forms.Label();
			this.uxIDNhaCungCap = new System.Windows.Forms.ComboBox();
			uxIDNhaCungCapLabel = new System.Windows.Forms.Label();
			this.uxHoTen = new System.Windows.Forms.TextBox();
			uxHoTenLabel = new System.Windows.Forms.Label();
			this.uxEmail = new System.Windows.Forms.TextBox();
			uxEmailLabel = new System.Windows.Forms.Label();
			this.uxDiaChi = new System.Windows.Forms.TextBox();
			uxDiaChiLabel = new System.Windows.Forms.Label();
			this.uxTieuDe = new System.Windows.Forms.TextBox();
			uxTieuDeLabel = new System.Windows.Forms.Label();
			this.uxNoiDung = new System.Windows.Forms.TextBox();
			uxNoiDungLabel = new System.Windows.Forms.Label();
			this.uxThoiDiemCapNhat = new System.Windows.Forms.DateTimePicker();
			uxThoiDiemCapNhatLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDNhaCungCapLienHeLabel
			//
			this.uxIDNhaCungCapLienHeLabel.Text = "IDNhaCungCapLienHe:";
			this.uxIDNhaCungCapLienHeLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDNhaCungCapLienHeLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNhaCungCapLienHeLabel);			
			//
			// uxIDNhaCungCapLienHe
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNhaCungCapLienHe);
			this.uxIDNhaCungCapLienHe.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIDNhaCungCapLienHe);
			//
			// uxIDNhaCungCapLabel
			//
			this.uxIDNhaCungCapLabel.Text = "IDNhaCungCap:";
			this.uxIDNhaCungCapLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDNhaCungCapLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNhaCungCapLabel);			
			//
			// uxIDNhaCungCap
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNhaCungCap);
			this.uxIDNhaCungCap.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDNhaCungCap);
			//
			// uxHoTenLabel
			//
			this.uxHoTenLabel.Text = "HoTen:";
			this.uxHoTenLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxHoTenLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxHoTenLabel);			
			//
			// uxHoTen
			//
			this.uxHoTen.Width = 250;
			this.uxHoTen.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxHoTen);
			this.uxHoTen.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxHoTen);
			//
			// uxEmailLabel
			//
			this.uxEmailLabel.Text = "Email:";
			this.uxEmailLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxEmailLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxEmailLabel);			
			//
			// uxEmail
			//
			this.uxEmail.Width = 250;
			this.uxEmail.MaxLength = 255;
			//this.uxTableLayoutPanel.Controls.Add(this.uxEmail);
			this.uxEmail.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxEmail);
			//
			// uxDiaChiLabel
			//
			this.uxDiaChiLabel.Text = "DiaChi:";
			this.uxDiaChiLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxDiaChiLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDiaChiLabel);			
			//
			// uxDiaChi
			//
			this.uxDiaChi.Width = 250;
			this.uxDiaChi.MaxLength = 1024;
			//this.uxTableLayoutPanel.Controls.Add(this.uxDiaChi);
			this.uxDiaChi.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxDiaChi);
			//
			// uxTieuDeLabel
			//
			this.uxTieuDeLabel.Text = "TieuDe:";
			this.uxTieuDeLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxTieuDeLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTieuDeLabel);			
			//
			// uxTieuDe
			//
			this.uxTieuDe.Width = 250;
			this.uxTieuDe.MaxLength = 200;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTieuDe);
			this.uxTieuDe.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxTieuDe);
			//
			// uxNoiDungLabel
			//
			this.uxNoiDungLabel.Text = "NoiDung:";
			this.uxNoiDungLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxNoiDungLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNoiDungLabel);			
			//
			// uxNoiDung
			//
			this.uxNoiDung.Width = 250;
			this.uxNoiDung.MaxLength = 16;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNoiDung);
			this.uxNoiDung.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxNoiDung);
			//
			// uxThoiDiemCapNhatLabel
			//
			this.uxThoiDiemCapNhatLabel.Text = "ThoiDiemCapNhat:";
			this.uxThoiDiemCapNhatLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxThoiDiemCapNhatLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxThoiDiemCapNhatLabel);			
			//
			// uxThoiDiemCapNhat
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxThoiDiemCapNhat);
			this.uxThoiDiemCapNhat.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxThoiDiemCapNhat);
			//
			// uxIDNhaCungCap
			//				
			this.uxIDNhaCungCap.DisplayMember = "NhaCungCap";	
			this.uxIDNhaCungCap.ValueMember = "IDNhaCungCap";	
			// 
			// NhaCungCapLienHeEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "NhaCungCapLienHeEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.NhaCungCap> _IDNhaCungCapList;
		
		/// <summary>
		/// The ComboBox associated with the IDNhaCungCap property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.NhaCungCap> IDNhaCungCapList
		{
			get {return _IDNhaCungCapList;}
			set 
			{
				this._IDNhaCungCapList = value;
				this.uxIDNhaCungCap.DataSource = null;
				this.uxIDNhaCungCap.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDNhaCungCapList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDNhaCungCap property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDNhaCungCapList
		{
			get { return _allowNewItemInIDNhaCungCapList;}
			set
			{
				this._allowNewItemInIDNhaCungCapList = value;
				this.uxIDNhaCungCap.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
